package com.ktgj.customer.service;

import com.ktgj.common.core.web.domain.AjaxResult;
import com.ktgj.customer.domain.Customer;
import com.ktgj.customer.domain.Employee;
import org.apache.ibatis.annotations.Param;

import javax.servlet.http.HttpServletRequest;
import java.text.ParseException;
import java.util.Map;

public interface ILoginService {
    //员工登录
    public Employee employeeLogin(String loginId, String loginPwd) throws Exception;
    //获取当前登录员工信息
    public Employee getLoginEmployee(HttpServletRequest request);
    //用户登录
    public Customer customerLogin(String loginId, String loginPwd) throws Exception;
    //获取当前登录用户信息
    public Customer getLoginCustomer(HttpServletRequest request);
    //用户修改密码
    public int updatePwd(Long customerId, String pwd);
    //用户修改12306密码
    public int updatetrainPassword(Long customerId, String trainPassword);
    //用户手机号登录
    public Customer customerPhoneLogin(String phone, String code) throws ParseException;
    //短信验证码发送接口
    String smsLoginCode(String phone);
    //小程序登录
    Customer appletLogin(String profileAvatar, String nickname, String phone, String openId);

    public AjaxResult appletAuth(String code, HttpServletRequest request);

    //注册
    public Customer register(Customer customer, String type);

    /**
     * 小程序手机号解密
     * @param map
     * @return
     */
    AjaxResult appletDecodePhone(Map<String, String> map);

    Customer getLoginCustomerByToken(String token);

    Employee getLoginEmployeeByToken(String token);

    /**
     * 短信修改密码
     * */
    public int updatePwd(String newPwdOne, String newPwdTwo, Customer customer) throws Exception;

    /**
     * 员工修改密码
     * */
    public int updatePassword(HttpServletRequest request, String oldPwd, String newPwdOne, String newPwdTwo) throws Exception;

    /**
     * 员工退出登录
     * @param token
     * @return
     */
    public boolean logOut(String token);
}
